package com.songlanyun.modules.like.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.songlanyun.common.enums.OpusConstant;
import com.songlanyun.common.utils.PageUtils;
import com.songlanyun.common.utils.RedisKeys;
import com.songlanyun.modules.like.entity.LikeRecord;
import com.songlanyun.modules.like.model.vo.MyLikeVO;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * 点赞记录表
 *
 * @author wuchao
 * @email sunlightcs@gmail.com
 * @date 2021-02-24 17:19:32
 */
public interface LikeRecordService extends IService<LikeRecord> {

    PageUtils queryPage(Map<String, Object> params);

    Boolean like(OpusConstant.ModelType modelType, Long modelId, Long likeUserId, Long publisherId, Date time);

    void delLike(Long userId, OpusConstant.ModelType modelType, Long modelId);

    PageUtils myPage(Map<String, Object> params);

    IPage<MyLikeVO> myLikePage(HashMap<String, Object> params);

    Integer likeSumByUserId(Long userId);

    Boolean isLike(Long userId, OpusConstant.ModelType opus, Long modelId);

    Boolean delLikeRedis(Long userId, RedisKeys.BbsKey bbsKey, Long modelId);

    Integer likeSum(OpusConstant.ModelType modelType,Long modelId);

    void modelDel(OpusConstant.ModelType modelType, Long modelId);
}

